<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
{% comment %}
Copyright 2012, Le Tuan Anh (tuananh.ke@gmail.com)
This file is part of VisualKopasu.
VisualKopasu is free software: you can redistribute it and/or modify 
it under the terms of the GNU General Public License as published by 
the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.
VisualKopasu is distributed in the hope that it will be useful, but 
WITHOUT ANY WARRANTY; without even the implied warranty of 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License 
along with VisualKopasu. If not, see http://www.gnu.org/licenses/.
{% endcomment %}
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
	<head>
		<title>{{title}}</title>
		<link rel="stylesheet" href="/static/css/redmond/jquery-ui-1.9.0.custom.min.css" />
		<link rel="stylesheet" href="/static/css/visualkopasu.css" />
		<script type="text/javascript" src="/static/js/jquery-1.8.2.min.js"></script>
		<script src="/static/js/jquery-ui-1.9.0.custom.min.js"></script>
		
		<script type="text/javascript">
			$(document).ready(function() {
		        initialise();
			});
			
			function initialise(){
				$("#btnAdvanceSearch").button().click(function(){
					window.location = "/search/";			
				});
				$("#btnShowXML").button().click(function(){
					window.open("/original/?ident={{sentence_ident}}");			
				});
				$("#btnSearch").button();
				$("#form_search").submit(function(){
					if($("#user_query").val().length == 0){
						alert("Please enter your query");
						return false;						
					}
				});
				$("#btnShowBasket").button({ text: false
			 	, icons: { primary: "ui-icon-suitcase"	}
				}).click(function(){
				window.location = "/basket";	
				});
			}
		</script>		
	</head>

	<body>
		<div id="banner" class="ui-widget-header ui-corner-all">
		{{header}}
		</div>
		<form id="form_search" action="/search/" method="POST">
		{% csrf_token %}
			<div id="toolbar" class="ui-corner-all">
				<button id="btnAdvanceSearch" name="btnAdvanceSearch" type="button">Advance Search</button>
				<span id="effect" class="toolbar_label">Search</span>
				<input id="user_query" name="user_query" />
				<button type="submit" id="btnSearch" name="btnSearch">Quick Search</button>
				<button type="button" id="btnShowBasket" name="btnAdvanceSearch">Show clipped DMRS</button>
			</div>
		</form>
		
		<h1>Available Corpora</h1>
		
		<ol class="sentence_list">
		{% for corpus in corpora %}
			<li>Corpus: {{corpus.name}}
				<ul>
				{% for document in corpus.documents %}
					<li><a href="/doc/?id={{document.ID}}">{{document.name}}</a></li>
				{% endfor %}
				</ul>
			</li>
		{% endfor %}
		</ol>
	</body>
</html>
